package com.android.wheretogo.setconnection;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.http.HttpConnection;

public class SetHttpURLConnection {
	public HttpURLConnection setHttpURLConnection(String uri){
		HttpURLConnection httpURLConnection = null;
		try {
			URL url = new URL(uri);
			httpURLConnection = (HttpURLConnection)url.openConnection();
			httpURLConnection.setDoInput(true);
			httpURLConnection.setDoOutput(true);
			httpURLConnection.setUseCaches(false);
			httpURLConnection.setRequestMethod("POST");
			httpURLConnection.setRequestProperty("Connection", "Keep-Alive");
			httpURLConnection.setRequestProperty("Charset", "UTF-8");
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return httpURLConnection;
	}

}
